import axios from 'axios';
const server = axios.create({
    baseURL: '/api',
    timeout: 4000
})
// 请求
server.interceptors.request.use(config => {
    return config
}, err => {
    return Promise.reject(err);
})
// 响应
server.interceptors.request.use(config => {
    return config
}, err => {
    return Promise.reject(err);
})

const Request = (params) => {
    return new Promise((resolve, reject) => {
        server({
            ...params
        })
        .then(res => resolve(res))
        .catch(err => reject(err))
    })

}
export default Request
